Field of the Invention
The present invention relates to an information processing apparatus, a method for controlling the information processing apparatus, and a storage medium.
Description of the Related Art
A standard, Wi-Fi Direct (registered trademark), has been established by the Wi-Fi Alliance. In Wi-Fi Direct, a protocol is defined to determine whether an image processing device, such as a printing device or a personal computer (PC), operates as an access point or a client. By utilizing the protocol, an image forming apparatus as the access point and an image forming apparatus as the client can be automatically determined. Wi-Fi Direct enables direct wireless communications between image processing apparatuses without employing a separately prepared access point.
FIG. 1 is a diagram simply illustrating a processing sequence in Wi-Fi Direct. The printing device and the mobile terminal are each an example of an information processing apparatus supporting Wi-Fi Direct.
First, the printing device and the mobile terminal each search for a device to specify a communication partner in step S101. Once the communication partners are specified through the device search, which will be the access point (Group Owner) and which will be the client (Client) are determined in step S102. The processing in step S102 will be referred to as role determination. In FIG. 1, the printing device is determined as Group Owner and the mobile terminal is determined as Client as a result of the role determination.
Next, the printing device as Group Owner provides a parameter for establishing a connection to the mobile terminal as Client, by using Wi-Fi Protected Setup (WPS) defined by Wi-Fi Alliance. Thus, the parameter is shared between the printing device and the mobile terminal in step S103. Then, a secure connection is established by using the parameter in step S104.
Once the secure connection is established, addressing is performed to establish IP communications between the printing device and the mobile terminal in step S105. Here, the printing device as Group Owner operates as a dynamic host configuration protocol (DHCP) server and provides an IP address to the mobile terminal as Client.
Through the processing described above, wireless communications between the printing device and the mobile terminal are established. The wireless communications enable the printing device and the mobile terminal to directly communicate with one another without employing a separately prepared access point. Japanese Patent Application Laid-Open No. 2012-199884 discusses a technique of transmitting and receiving sound or photo data by using Wi-Fi Direct described above.
In some cases, a predefined port permitted to be used for communications (permitted port) is set in an information processing apparatus, such as a printing device or a PC, to achieve higher security. In such an information processing apparatus, the processing of data is prohibited if a port used in the communications is not the permitted port. Thus, the security of the information processing apparatus can be improved.
However, when the mobile terminal transmits data to the printing device by using Wi-Fi Direct as illustrated in FIG. 1, the mobile terminal may not necessarily designate the permitted port of the printing device to transmit the data to the printing device. For example, when the mobile terminal is set in advance to designate a port other than the permitted port of the printing device, the data transmitted from the mobile terminal is not processed in the printing device.